﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ClientLibrary;

namespace DocumentDigitalization
{
    public partial class UserControl_MainPage : UserControl
    {
        Form form;
        SystemState Systemstate;

        public UserControl_MainPage()
        {            
            InitializeComponent();
        }

        public UserControl_MainPage(Form form, SystemState systate)
        {
            InitializeComponent();
            this.form = form;
            this.Systemstate = systate;
        }

        public void setSystemState(SystemState ss)
        {
            this.Systemstate = ss;
        }

        public void setForm(Form f)
        {
            this.form = f;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Visible = false;
            this.Enabled = false;
            UserControl_exportpdf uc_exportpdf = new UserControl_exportpdf(this.form, this.Systemstate);
            uc_exportpdf.Top = 24;
            uc_exportpdf.Left = 0;
            uc_exportpdf.Visible = true;
            uc_exportpdf.Enabled = true;
            form.Controls.Add(uc_exportpdf);
        }

        private void button3_Click(object sender, EventArgs e)
        {
            this.Visible = false;
            this.Enabled = false;
            UserControl_searchfiles uc_search = new UserControl_searchfiles(this.form, this.Systemstate);
            uc_search.Top = 24;
            uc_search.Left = 0;
            uc_search.Visible = true;
            uc_search.Enabled = true;
            form.Controls.Add(uc_search);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.Visible = false;
            this.Enabled = false;
            UserControl_storefiles uc_store = new UserControl_storefiles(this.form, this.Systemstate);
            uc_store.Top = 24;
            uc_store.Left = 0;
            uc_store.Visible = true;
            uc_store.Enabled = true;
            form.Controls.Add(uc_store);
        }
    }
}
